package com.zsh.rabbitmq.springbootrabbitmq.consumer;

import com.zsh.rabbitmq.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * @author zsh
 * @Description 发布确认模式，接收者
 * @create 2022-05-07 16:37
 */
@Slf4j
@Component
public class ConfirmConsumer {

    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void receiveConfirmMessage(Message message) throws Exception {
        String msg = new String(message.getBody(),"UTF-8");
        log.info("接收到的队列confirmQueue消息为：{}",msg);
    }
}
